﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Calculator
{
    public class Calculator
    {
        public decimal Calculate(decimal num1, decimal num2, Operation operation)
        {
            switch (operation)
            {
                case Operation.Add:
                    return num1 + num2;
                case Operation.Subtract:
                    return num1 - num2;
                case Operation.Multiply:
                    return num1 * num2;
                case Operation.Divide:
                    return num1 / num2;
            }
            return 0;
        }

        public bool IsValidExpression(string expression)
        {
            var operations = new[] { '+', '-', '*', '/' };
            return operations.Any(expression.Contains);
        }
    }
}
